<template>
  <div id="app">
    <router-view></router-view>
    <van-tabbar
      route
      v-model="active"
      active-color="#8b0000"
      inactive-color="#333"
      v-if="$route.meta.hasTabbar"
    >
      <van-tabbar-item to="/home" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item to="/topic" icon="label-o">专题</van-tabbar-item>
      <van-tabbar-item to="/category" icon="apps-o">分类</van-tabbar-item>
      <van-tabbar-item to="/cart" icon="cart-o">购物车</van-tabbar-item>
      <van-tabbar-item to="/user" icon="user-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
window.onload = function() {
  document.addEventListener('touchstart', function(event) {
    if (event.touches.length > 1) {
      event.preventDefault()
    }
  })
  document.addEventListener('gesturestart', function(event) {
    event.preventDefault()
  })
}
</script>

<style lang="less">
* {
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}
html,
body,
#app {
  width: 100%;
  height: 100%;
  background-color: #efefef;
  font-family: "Microsoft Yahei";
  font-size: 14px;
}
.home_title {
  width: 100%;
  height: 50px;
  line-height: 50px;
  text-align: center;
}
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  // background-color: #39a9ed;
}
.fade-leave-to,
.fade-enter {
  opacity: 0;
}
.fade-leave-active,
.fade-enter-active {
  transition: opacity 0.4s linear;
}
.fade-leave,
.fade-enter-to {
  opacity: 1;
}
</style>